package com.lwj.project1.RecommendPageFragments;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.Toast;
import com.lwj.project1.R;
public class LoopViewClickListener implements View.OnClickListener{

    Context mContext;
    public LoopViewClickListener(Context mContext){
        this.mContext=mContext;
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent(v.getContext(),ShowGameInfoActivity.class);
        switch (v.getId()) {
            // TODO 进入到商品详情页面
            case R.id.a_pager_img1:
//                Toast.makeText(mContext, "图片1被点击", Toast.LENGTH_SHORT).show();
                intent.putExtra("position",0);
                mContext.startActivity(intent);
                break;
            case R.id.a_pager_img2:
//                Toast.makeText(mContext, "图片2被点击", Toast.LENGTH_SHORT).show();
                intent.putExtra("position",1);
                mContext.startActivity(intent);
                break;
            case R.id.a_pager_img3:
//                Toast.makeText(mContext, "图片3被点击", Toast.LENGTH_SHORT).show();
                intent.putExtra("position",2);
                mContext.startActivity(intent);
                break;
            case R.id.a_pager_img4:
//                Toast.makeText(mContext, "图片4被点击", Toast.LENGTH_SHORT).show();
                intent.putExtra("position",3);
                mContext.startActivity(intent);
                break;
            case R.id.a_pager_img5:
//                Toast.makeText(mContext, "图片5被点击", Toast.LENGTH_SHORT).show();
                intent.putExtra("position",4);
                mContext.startActivity(intent);
                break;
        }
    }
}
